package hcn.protocol.brandnew.dengji.jianyanyuyue;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import org.atag.sysrouter.annotation.DictionaryMapping;

import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
 * 检验预约登记确认-请求消息 - ODS_02060004
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "MsgBody")
@XmlAccessorType(XmlAccessType.FIELD)
public class LabAppointSubmitRequest extends BaseRequest {

    /**
     * 患者信息
     */
    @XmlElement(name = "Request")
    private Request request;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class LabRequest {

        /**
         * 检验申请单编号
         */
        @XmlElement(name = "RequestId")
        private String requestId;
        /**
         * 检验项目代码
         */
        @XmlElement(name = "ItemCode")
        private String itemCode;
        /**
         * 检验项目名称
         */
        @XmlElement(name = "ItemName")
        private String itemName;
        /**
         * 标本类别代码
         */
        @XmlElement(name = "SampleTypeCode")
        private String sampleTypeCode;
        /**
         * 标本类别名称
         */
        @XmlElement(name = "SampleTypeName")
        private String sampleTypeName;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Request {

        /**
         * 就诊机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 就诊机构名称
         */
        @XmlElement(name = "VisitOrganizationName")
        private String visitOrganizationName;
        /**
         * 院区标识
         */
        @XmlElement(name = "HosArea")
        private String hosArea;
        /**
         * 业务系统患者档案ID
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 就诊卡类别代码
         */
        @XmlElement(name = "MedicalCardType")
        private String medicalCardType;
        /**
         * 就诊卡号
         */
        @XmlElement(name = "MedicalCardId")
        private String medicalCardId;
        /**
         * 身份证件号码
         */
        @XmlElement(name = "IdCard")
        private String idCard;
        /**
         * 身份证件类别代码
         */
        @XmlElement(name = "IdCardCode")
        @DictionaryMapping(id = "CV02_01_101")
        private String idCardCode;
        /**
         * 采样区编码
         */
        @XmlElement(name = "SampleCollectAreaId")
        private String sampleCollectAreaId;
        /**
         * 采样区名称
         */
        @XmlElement(name = "SampleCollectAreaName")
        private String sampleCollectAreaName;
        /**
         * 预约采样日期时间
         */
        @XmlElement(name = "AppointsVisitDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date appointsVisitDateTime;
        /**
         * 预约采样时段
         */
        @XmlElement(name = "AppointsVisitTime")
        private String appointsVisitTime;
        /**
         * 预约时段低值
         */
        @XmlElement(name = "EffectiveTimeLow")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date effectiveTimeLow;
        /**
         * 预约时段高值
         */
        @XmlElement(name = "EffectiveTimeHigh")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date effectiveTimeHigh;
        /**
         * 申请单集合
         */
        @XmlElementWrapper(name = "LabRequests")
        @XmlElement(name = "LabRequest")
        private List<LabRequest> labRequests;
    }

}
